package com.itbac.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 测试ｎａｃｏｓ动态刷新
 */
@RestController
@RequestMapping("/nacosTest")
@RefreshScope //支持配置文件的热更新
public class NacosTestController {
    @Value("${nacosTest.msg}")
    private String msg;

    //http://127.0.0.1:8091/nacosTest/getMsg
    @RequestMapping("/getMsg")
    public String getMsg() {
        return msg;
    }
}
